﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Isha.Extensions.File;
using Isha.Extensions.Folder;
using Isha.Extensions.Link;
using Isha.Extensions.Page;
using Isha.Infrastructure;
using Microsoft.Practices.Unity;
using System.ComponentModel.Composition;

namespace Isha.Extensions
{
    [Export(typeof(IModule))]
    public class ExtensionBinder : IModule
    {        
        public void Build()
        {
            IUnityContainer container = IshaBuilder.Container;

            container
                .RegisterType<IContentCommand, FolderCommand>("folder", new HttpContextLifetimeManager<IContentCommand>())
                .RegisterType<IContentCommand, PageCommand>("page", new HttpContextLifetimeManager<IContentCommand>())
                .RegisterType<IContentCommand, FileCommand>("file", new HttpContextLifetimeManager<IContentCommand>())
                .RegisterType<IContentCommand, LinkCommand>("link", new HttpContextLifetimeManager<IContentCommand>());  
        }
    }
}
